package dbVSguiConnection;


import java.net.URL;
import java.util.ArrayList;



import details.Artist;
import details.Cd;
import details.Comment;
import details.Like;
import details.Song;
import details.Track;
import details.User;

public class GuiGetReturnedResults implements GuiGetRerults_Interface {
	
	private String massage;
	private ArrayList<Cd> cds;
	private ArrayList<Artist> artists;
	private ArrayList<Song> songs;
	private ArrayList<Comment> comments;
	
	private Artist artist;
	private Cd cd;
	private Song  song;
	
	private String lyric;
	private URL cdCover;
	private ArrayList<Track> cdTracks;
	
	private User user;
	
	private Like like;
	
	private int likes;
	private boolean isUserLike;
	private boolean permitedLikeAct;
	

	@Override
	public void updateResultsTableWithCds(ArrayList<Cd> cds) {
		setCds(cds);
		setMassage(null);
	}

	@Override
	public void updateResultsTableWithSongs(ArrayList<Song> songs) {
		setSongs(songs);
		setMassage(null);
	}

	@Override
	public  void updateResultsTableWithArtists(ArrayList<Artist> artists) {
		setArtists(artists);
		setMassage(null);
	}
	
	
	@Override
	public  void refreshSongLyric(String lyric) {
		setLyric(lyric);
		setMassage(null);
		
	}

	@Override
	public void refreshSongComments(ArrayList<Comment> comments) {
		setComments(comments);
		setMassage(null);
		
	}

	@Override
	public void refreshCdLikes(int cdLikes) {
		setLikes(cdLikes);
		setMassage(null);
	}

	@Override
	public void refreshSongLikes(int songLikes) {
		setLikes(songLikes);
		setMassage(null);
	}

	@Override
	public void refreshArtistLikes(int artistLikes) {
		setLikes(artistLikes);
		setMassage(null);
	}

	@Override
	public void refreshUserLike(Like l) {
		setLike(l);
		setMassage(null);
		

	}
	
	@Override
	public void isIfUserLike(boolean isLike) {
		setUserLike(isLike);
		setMassage(null);
		
	}


	

	@Override
	public void updateCdTracks(ArrayList<Track> cdTracks) {
		setCdTracks(cdTracks);
		setMassage(null);
	}

	@Override
	public void updateCdCover(URL cdCover2) {
		setCdCover(cdCover2);
		setMassage(null);
		
	}

	@Override
	public void updateArtistCds(ArrayList<Cd> artistCds) {
		setMassage(null);
		setCds(artistCds);
	}

	@Override
	public void  updateTopArtist(ArrayList<Artist> topArtists) {
		setArtists(topArtists);
		setMassage(null);
	}

	@Override
	public void updateTopSongs(ArrayList<Song> topSongs) {
		setSongs(topSongs);
		setMassage(null);
	}

	@Override
	public void updateTopCds(ArrayList<Cd> topCds) {
		setCds(topCds);
		setMassage(null);
	}

	@Override
	public void notifyDBFailure(String dbErrormassage) {
		setMassage(dbErrormassage);
		
	}

	@Override
	public void notifyGeneralError(String generalErrormassage) {
		setMassage(generalErrormassage);
	}

	
	@Override
	public void updateCdInfo(Cd cd) {
		setCd(cd);
		setMassage(null);
	}

	@Override
	public  void updateSongInfo(Song song) {
		setSong(song);
		setMassage(null);
		
	}

	@Override
	public void updateArtistInfo(Artist artist) {
		setArtist(artist);
		setMassage(null);
	}

	public String getMassage() {
		return massage;
	}

	public void setMassage(String massage) {
		this.massage = massage;
	}

	public ArrayList<Cd> getCds() {
		return cds;
	}

	public void setCds(ArrayList<Cd> cds) {
		this.cds = cds;
	}

	public ArrayList<Artist> getArtists() {
		return artists;
	}

	public void setArtists(ArrayList<Artist> artists) {
		this.artists = artists;
	}

	public ArrayList<Song> getSongs() {
		return songs;
	}

	public void setSongs(ArrayList<Song> songs) {
		this.songs = songs;
	}

	public ArrayList<Comment> getComments() {
		return comments;
	}

	public void setComments(ArrayList<Comment> comments) {
		this.comments = comments;
	}

	public Artist getArtist() {
		return artist;
	}

	public void setArtist(Artist artist) {
		this.artist = artist;
	}

	public Cd getCd() {
		return cd;
	}

	public void setCd(Cd cd) {
		this.cd = cd;
	}

	public Song getSong() {
		return song;
	}

	public void setSong(Song song) {
		this.song = song;
	}


	public URL getCdCover() {
		return cdCover;
	}

	public void setCdCover(URL cdCover2) {
		this.cdCover = cdCover2;
	}

	public String getLyric() {
		return lyric;
	}

	public void setLyric(String lyric) {
		this.lyric = lyric;
	}

	public ArrayList<Track> getCdTracks() {
		return cdTracks;
	}

	public void setCdTracks(ArrayList<Track> cdTracks) {
		this.cdTracks = cdTracks;
	}

	public int getLikes() {
		return likes;
	}

	public void setLikes(int likes) {
		this.likes = likes;
	}

	public Like getLike() {
		return like;
	}

	public void setLike(Like like) {
		this.like = like;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Override
	public void notifySuccess() {
		setMassage(null);
		
	}

	public boolean getUserLike() {
		return isUserLike;
	}

	public void setUserLike(boolean isUserLike) {
		this.isUserLike = isUserLike;
		this.setPermitedLikeAct(!isUserLike);
	}

	public boolean getPermitedLikeAct() {
		return permitedLikeAct;
	}

	public void setPermitedLikeAct(boolean permitedLikeAct) {
		this.permitedLikeAct = permitedLikeAct;
	}

	
}
